- /* scmfput.cpp by K.Tsuru */
- // function ID = 900
- /**************************
- SComplex class
- It provides the output.
- **************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- long SComplex::Put(int fmt) const { // change since ver.2.21
- scLineFormat = fmt; ioCount = 0;
- SDouble abs_im;
- long p = 0;
- if(scLineFormat & BracketFMT){
- re.FPutc('('); p++;
- p += re.Put();
- re.FPuts(", "); p += 2;
- if(scLineFormat & MID_CR) { re.FPutc('\n'); p++; }
- p += im.Put();
- re.FPutc(')'); p++;
- if(scLineFormat & END_CR){ re.FPutc('\n'); p++; }
- return ioCount = p;
- }
- int imSign = im.Sign(900);
- if(imSign < 0) abs_im = Dabs(im);
-
- if(scLineFormat & MID_CR) p = re.Puts();
- else p = re.Put();
-
- if(imSign < 0){
- p += re.FPuts("-i*");
- p += abs_im.Put();
- } else if(imSign > 0){
- p += re.FPuts("+i*");
- p += im.Put();
- } else p += re.FPuts("+i*0.0");
-
- if(scLineFormat & END_CR){
- re.FPutc('\n'); p++;
- }
- return ioCount = p;
- }
scmput.cpp : last modifiled at 2017/06/16 11:51:26(983 bytes)
created at 2017/10/06 15:21:28
The creation time of this html file is 2017/10/06 15:27:09 (Fri Oct 06 15:27:09 2017).